const userService = require('../services/user.service');

exports.create = async (req, res) => {
  try {
    const newUser = await userService.createUser(req.body);
    res.status(201).json(newUser);
  } catch (error) {
    res.status(400).json({ error: error.message });
  }
};

exports.findAll = async (req, res) => {
  const users = await userService.getAllUsers();
  res.json(users);
};

// 其他方法类似...